package com.jie.other.compose

import android.os.Bundle
import android.widget.FrameLayout
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.material.MaterialTheme
import androidx.core.view.WindowCompat
import androidx.core.view.setPadding
import com.jie.other.compose.study02.StudyO2Page

/**
 * Compose学习第二课
 */
class Study02Activity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        // 设置沉浸式状态栏（使布局延伸到状态栏）
        WindowCompat.setDecorFitsSystemWindows(window, false)
        // 设置状态栏背景为透明色
        window.statusBarColor = android.graphics.Color.TRANSPARENT
        WindowCompat.getInsetsController(window, window.decorView).apply {
            // true:状态栏字体为黑色 false:状态栏字体为白色
            isAppearanceLightStatusBars = true
        }
        setContent {
            MaterialTheme {
                StudyO2Page(
                    backClick = {
                        finish()
                    }
                )
            }
        }
    }
}